<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:a4j="http://richfaces.org/a4j">

    <ui:composition template="template.xhtml">
        <ui:define name="content">


            <h:form>
                <rich:panel>
                    <f:facet name="header">
                        <h:panelGroup>
                            <h:outputText value="Usuário" />
                            <a4j:status>
                                <f:facet name="start">
                                    <h:graphicImage value="/images/ai.gif" alt="ai" style="height:12px;width:12px;"/>
                                </f:facet>
                            </a4j:status>
                        </h:panelGroup>
                    </f:facet>
                    <h:panelGrid columns="3">
                        <h:outputText value="Nome:" />
                        <h:inputText value="#{UsuarioController.usuario.nome}" id="nome">
                        </h:inputText>
                        <rich:message for="name" />
                        <h:outputText value="Login" />
                        <h:inputText value="#{UsuarioController.usuario.login}" id="login">
                        </h:inputText>
                        <rich:message for="login" />
                        <h:outputText value="Senha" />
                        <h:inputText value="#{UsuarioController.usuario.senha}" id="senha">
                        </h:inputText>
                        <rich:message for="senha" />
                        <h:outputText value="Data Nascimento" />
                        <rich:calendar value="#{UsuarioController.usuario.data}" id="data">
                            <a4j:support event="onchanged" reRender="mainTable"/>
                        </rich:calendar>
                        <br/>
                        <a4j:commandButton value="Inserir Novo Usuário"
                                           action="#{UsuarioController.adicionarUsuario}" />
                        <a4j:commandButton value="Alterar Usuário"
                                           action="#{UsuarioController.alterarUsuario}" />

                        <br/>
                        <h:commandLink action="usuarioJsf" value="Voltar"/>
                    </h:panelGrid>
                </rich:panel>
            </h:form>


        </ui:define>
    </ui:composition>
</html>